# File: 建⽴forms.py
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
# 定制我的注册表 单，⽐系统的提供字段少，没有的邮箱附加上，
class CreateUserForm(UserCreationForm):# 从已知数据库里取数据
    email = forms.EmailField()
    class Meta:
        model = User  # 所有字段来自user表
        fields = ['username', 'email', 'password1', 'password2']
